﻿using SourceStack.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace SourceStack.Repositories
{
    internal class UserRepository
    {
        private static IList<User> users;
        static UserRepository()
        {
            users = new List<User>
            {
            new User
            {
                Id=1,
                Name="叶飞",
                Password="123"

            }

            };
        }
        public void Save(User user)
        {
            users.Add(user);
        }

        internal User GetByName(string name)
        {
            return users.Where(u => u.Name == name).SingleOrDefault();
        }

     
    }
}
